﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Reflection; //ooooooo
using System.Threading;

namespace PaladoreQuestItem
{
    public partial class about_form : Form
    {
        public about_form()
        {
            InitializeComponent();
        }

        private void cycleColors()
        {
            int count = 180;
            foreach (PropertyInfo pi in typeof(Color).GetProperties())
            {
                Color c = new Color();
                if (pi.PropertyType == typeof(Color)) //if the property is a color, 
                {
                    Color temp = (Color)pi.GetValue(c, null);
                    if (temp != Color.Transparent)
                    {
                        this.BackColor = temp;
                        linkLabel1.BackColor = temp;
                    }
                }
                count += 10;
                Thread.Sleep(count);
            }
            this.BackColor = about_form.DefaultBackColor;
            linkLabel1.BackColor = about_form.DefaultBackColor;
        }

        private void about_form_FormClosed(object sender, FormClosedEventArgs e)
        {
            Form1.ab = null;
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {
            
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            

        }

        private void linkLabel1_Click(object sender, EventArgs e)
        {
            //while this is a threaded operation, the more important threaded operation
            //which actually performs a task is under allToolStripMenuItem_Click in Form1
            Thread t = new Thread(cycleColors);
            t.IsBackground = true;
            t.Start();
            System.Diagnostics.Process.Start("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FX24PBCB94ZDQ");
            this.TopMost=true;
            this.BringToFront();
            Thread.Sleep(200);
            this.TopMost = false;
        }

        private void linkLabel1_MouseHover(object sender, EventArgs e)
        {
            Cursor = Cursors.Hand;
        }

        private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            //link to forum post
            System.Diagnostics.Process.Start("http://www.paladore.com/forums.php?action=viewtopic&topicid=1925");
        }

        private void linkLabel1_MouseLeave(object sender, EventArgs e)
        {
            Cursor = Cursors.Default;
        }
    }
}
